package app;

public class ArithmeticMean {

    /**
     * @param args
     */
    public static void main(String[] args) {

	double[] array = { 10.5, 10.8, 11.2, 10.9, 10.4, 10.6, 10.9, 11.0,
		10.3, 10.8, 10.6, 11.3, 10.5, 10.7, 10.8, 10.9, 10.8, 10.7,
		10.9, 11.0 };
	double sum = 0;
	for (double i : array) {
	    sum += i;

	}
	double aritheticMean = sum / array.length;
	System.out.println("Среднее арифметическое " + aritheticMean);

	double dispersion = 0;

	for (double i : array) {
	    dispersion += (i - aritheticMean) * (i - aritheticMean);
	}

	dispersion = dispersion / (array.length - 1);

	System.out.println(dispersion);

	double standardDeviation = Math.sqrt(dispersion / array.length);
	System.out.println(standardDeviation);

	double[] array2 = new double[1000];
	double summa = 0;

	double x = 2.0;
	for (int i = 0; i < array2.length; i++) {

	    array2[i] = Math.pow(x, i) / fact(i);
	}

    }

    public static int fact(int num) {
	return (num == 0) ? 1 : num * fact(num - 1);
    }
}
